{layout name="pub/pub_css_js" /}
<script type="text/javascript" src="/static/js/vue2.5.1.js"></script>
<script src="/static/js/axios.min.js"></script>
<script type="text/javascript" src="__STATIC__/admin_page/lib/jquery/1.9.1/jquery.min.js"></script>
<script src="/static/js/jquery.base64.js"></script>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 用户管理<span
        class="c-gray en">&gt;</span> 注册量统计 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
                                               href="/admin/User/LookRegister" title="刷新"><i
        class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container" id="app">
    <div class="text-c">

        <span style="font-size: 18px">总用户: &nbsp &nbsp {$number}  &nbsp&nbsp人</span> <span>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</span>
        {literal}日期范围：
        <input type="text" onfocus="WdatePicker({ maxDate:'#F{$dp.$D(\'logmax\')||\'%y-%M-%d\'}' })"   value="" id="logmin"
               name="start_time" class="input-text Wdate" style="width:120px;">
        -
        <input type="text" onfocus="WdatePicker({ minDate:'#F{$dp.$D(\'logmin\')}',maxDate:'%y-%M-%d' })" value=""  id="logmax"
               name="end_time" class="input-text Wdate" style="width:120px;">
        {/literal}
        &nbsp&nbsp
        <button name="" @click="goComment" class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i>
            搜索
        </button>
        &nbsp&nbsp
        <a href="javascript:void(0);" @click="Download" class="btn btn-primary upload-btn"><i class="Hui-iconfont">&#xe642;</i>
            下载Excel</a>
    </div>
    <div class="mt-20">
        <table class="table table-border table-bordered table-bg table-hover table-sort table-responsive">
            <thead>
            <tr class="text-c">
                <th width=160">日期</th>
                <th width=160">注册数</th>

            </tr>
            </thead>
            <tbody>
            {foreach $data as $vo}
            <tr class="text-c">
                <td>{$vo['time']}</td>
                <td>{$vo['total']}</td>
            </tr>
            {/foreach}
            </tbody>

        </table>
    </div>
</div>
<script>
    new Vue({
        el: '#app',
        data: {
            start_time: "",
            end_time: "",
        },
        created() {
        },
        methods: {
            goComment() {
                this.start_time = $('#logmin').val();
                this.end_time = $('#logmax').val();
                if (this.start_time.length == 0) {
                    layer.alert('请选择开始时间');
                    return false;

                }
                if (this.end_time.length == 0) {
                    layer.alert('请选择结束时间');
                    return false;
                }
                window.location.href = '/admin/User/LookRegister?start_time=' + this.start_time + '&end_time=' + this.end_time;
            },
            Download() {
                this.start_time = $('#logmin').val();
                this.end_time = $('#logmax').val();
                if (this.start_time.length == 0) {
                    layer.alert('请选择开始时间');
                    return false;

                }
                if (this.end_time.length == 0) {
                    layer.alert('请选择结束时间');
                    return false;
                }
                window.location.href = '/admin/User/LookRegister?start_time=' + this.start_time + '&end_time=' + this.end_time + '&download=1';
            }
        }
    });
</script>

